using System.Data;
using NCS.Library.Components.Providers;
using NCS.Module.FeedBack.Library.Components;

namespace NCS.Module.FeedBack.Library.Providers
{
	public abstract class DataProvider
	{
		private static DataProvider objProvider;
		public static DataProvider Instance()
		{
			if (objProvider == null)
			{
				DataAccessProviderConfiguration objConfig = DataAccessProviderConfiguration.GetDataAccessProviderConfiguration();
				Provider defaultProvider = (Provider)objConfig.Providers[objConfig.DefaultProvider];
				Provider provider = new Provider(defaultProvider.ProviderName, "NCS.Module.FeedBack.Library.Providers." + defaultProvider.ProviderName, defaultProvider.ConnectionString);
				objProvider = (DataProvider)DataAccessProviderFactory.CreateDataAccess(provider);
			}
			return objProvider;
		}
		public abstract DataTable GetFeedBacks(int status);
		public abstract FeedBackInfo GetFeedBack(int fpId);
		public abstract int AddFeedBack(FeedBackInfo fb);
		public abstract void UpdateFeedBack(FeedBackInfo fb);
		public abstract void DeleteFeedBack(FeedBackInfo fb);
		public abstract void DeleteFeedBack(int fbId);
		public abstract void SetStatus(int fbId, int status);
	}
}